Skip to content

Instantly share code, notes, and snippets.

@w-e-w
w-e-w / sd-webui-txt2img-img2img-api-example.py
Last active May 14, 2024 00:53
Stable Diffusion web UI txt2img img2img api example script
from datetime import datetime
import urllib.request
import base64
import json
import time
import os
webui_server_url = 'http://127.0.0.1:7860'
out_dir = 'api_out'
@petersenna
petersenna / backup_history.bash
Last active May 14, 2024 00:50
Add this to your .bashrc to create a backup of your bash history every time you open a new terminal, but not more than one time per hour(find -mmin +60). This will backup your bash history if it has more lines than the backup file.
export HISTSIZE=""
HIST_FILE=~/.bash_history
BACK_FILE=~/.bash_history_backup
if [ ! -f $BACK_FILE ];then touch -d "2 hours ago" $BACK_FILE;fi
if test $(find $BACK_FILE -mmin +60); then
HIST_SIZE=$(cat $HIST_FILE|wc -l)
BACK_SIZE=$(cat $BACK_FILE|wc -l)
GROWTH=$(($HIST_SIZE - $BACK_SIZE))
@sebjai
sebjai / short_term_alpha.ipynb
Last active May 14, 2024 00:49
Market Making in Short-Term Alpha (Chapter 10.4.2 of Algorithmic and High-Frequency Trading by Cartea, Jaimungal, Penalva, published by Cambridge University Press)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FabulousCupcake
FabulousCupcake / windows-bluetooth-autoconnect.md
Created August 27, 2021 18:49
Actually Disabling Bluetooth Autoconnect on Startup in Windows

Actually Disabling Bluetooth Autoconnect on Startup in Windows

Situation

I use multiple devices with my bluetooth earphone connected to my mac machine, phone, or tablet.
When I boot my windows machine, it automatically connects to and snatches my bluetooth earphone. This is very annoying.

Results from google on ways to disable this are unhelpful:

  • Unpair the device (???)
  • Disable bluetooth support system service via services.msc
  • Disable the device via Device Manager
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active May 14, 2024 00:46
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@omergoktas
omergoktas / memavail.cpp
Created July 14, 2020 22:18
Get Available Memory in the System [Cross-Platform]
#include <cstddef> // size_t
#if defined (__linux__)
# include <sys/sysinfo.h>
#elif defined (__APPLE__)
# include <mach/mach.h>
# include <mach/mach_host.h>
#elif defined (_WIN32)
# include <windows.h>
#endif
@rsms
rsms / macos-distribution.md
Last active May 14, 2024 00:39
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@ShinGyeongseon367
ShinGyeongseon367 / CKA.md
Last active May 14, 2024 00:34
CKA 취득 후기 및 팁 (참고, 인용: seongjin)

Welcome to CKA(Certified Kubernetes Administrator)

This is an image 출처: https://training.linuxfoundation.org/certification/certified-kubernetes-administrator-cka/

CKA(Certified Kubernetes Administrator)을 취득하였다.

CKA는 Linux Foundation과 CNCF(Cloud Native Computing Foundation)에서 Kubernetes 에코시스템 개발을 지원하기 위한 지속적인 노력의 일환으로 만들었습니다. CKA는 Kubernetes를 실행하는 명령줄에서 여러 작업을 해결해야 하는 감독이 있는 온라인 성능 기반 테스트입니다. "인용: https://training.linuxfoundation.org/certification/certified-kubernetes-administrator-cka/"

@MSAdministrator
MSAdministrator / download_malware_samples.py
Created January 7, 2022 02:33
Download Malicious Files from malware-traffic-analysis.net
import os
import requests
from bs4 import BeautifulSoup
import time
import re
import io
from zipfile import ZipFile
EXTENSION_LIST = [
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}